import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_app/BaseMaterialWidget.dart';

class TextFieldDemo extends BaseMaterialWidget {
  List<Widget> list = List<TextField>.generate(
      10,
      (index) => TextField(
            maxLength: 20,
            maxLines: 1,
            autocorrect: true,
            autofocus: true,
            onChanged: (text) {
              print('onChange:$text');
            },
            decoration: InputDecoration(hintText: '请输入用户名', prefixText: '用户名：'),
          ));
  List<Widget> cardList = List<Card>.generate(
      10,
      (index) => Card(
            borderOnForeground: true,
            color: Colors.white,
            child: Column(
              children: <Widget>[
                ListTile(
                  title: Text('主标题'),
                  subtitle: Text('副标题'),
                ),
              ],
            ),
          ));

  @override
  Widget buildContent(BuildContext context) {
    return ListView(
      children: cardList,
    );
  }

  @override
  String getTitle() {
    return '文本框和Card';
  }
}
